import axios from "@/api/request";

const categoryType = {
    add: "/back/categoryType/add",
    update: "/back/categoryType/update",
    delete: "/back/categoryType/delete",
    findById: "/back/categoryType/findById",
    findAll: "/back/categoryType/findAll",
    search: "/back/categoryType/search",
}
const category = {
    add: "/back/category/add",
    update: "/back/category/update",
    delete: "/back/category/delete",
    findById: "/back/category/findById",
    updateStatus: "/back/category/updateStatus",
    findAll: "/back/category/findAll",
    search: "/back/category/search",
    searchByType: "/back/category/searchByType",
}


const api = {
    categoryType_add(params) {
        return axios.post(categoryType.add, params)
    },
    categoryType_update(params) {
        return axios.post(categoryType.update, params)
    },
    categoryType_delete(params) {
        return axios.delete(categoryType.delete, {params})
    },
    categoryType_findById(params) {
        return axios.get(categoryType.findById, {params})
    },
    categoryType_findAll(params) {
        return axios.get(categoryType.findAll, {params})
    },
    categoryType_search(params) {
        return axios.get(categoryType.search, {params})
    },


    category_add(params) {
        return axios.post(category.add, params)
    },
    category_update(params) {
        return axios.post(category.update, params)
    },
    category_delete(params) {
        return axios.delete(category.delete, {params})
    },
    category_findById(params) {
        return axios.get(category.findById, {params})
    },
    category_updateStatus(params) {
        return axios.get(category.updateStatus, {params})
    },
    category_search(params) {
        return axios.get(category.search, {params})
    },
    category_searchByType(params) {
        return axios.get(category.searchByType, {params})
    },

}
export default api
